Who doubts? Most English translations render v. 17: "When they saw him, they worshiped him; but some doubted" (NRSV). However, the word "some" doesn't occur in the text. The little Greek word de is often translated "but," but it can also mean "and". With this understanding, the verse could be translated: "And seeing him they worshiped and they doubted."
Those who worship are also those who doubt -- like being simultaneously saint and sinner, or the divine and human natures in Jesus, or the body/bread, blood/wine of communion. We frequently talk about two things existing at the same time.
Mark Allan Powell writes about this verse in his book, Loving Jesus: I want to note that the word some is not actually found in the Greek Bible. Why is it in the English version? Well, Matthew uses a particular construction here that allows translators to think that the word some could be implied. He also uses that construction in seventeen other instances, though no one ever seems to think the word is implied in those cases. It could be implied here, but why would it be? I asked a Bible translator that question one time and got the following response: "The verse wouldn't make sense otherwise. No one can worship and doubt at the same time." I invited this fellow to visit a Lutheran church. We do it all the time.